import requests
from config import url, headers_web


class CourseContent:

    def __init__(self):
        self.url = url
        self.headers = headers_web

    @classmethod
    def get_classtimelist(cls, url: str, params=None, headers=headers_web):
        """
        @Summary:接口-获取教学内容信息课次信息
        @Description:Web学生端使用
        :param url:
        :param params:
        :return:
        """
        pass

    @classmethod
    def post_existcoursecontent(cls, url: str, params, json, headers, paramspath):
        """
        @Summary:接口-判断课程结构下是否存在教学内容
        @Description:云课堂老师端课程结构删除使用
        :param url:
        :param params:{
                        "userId":"", # 用户Id
                        "userName":"", # 用户名称
                        "validCode":"" # id=?&signKey=123123(md5加密)
                        }
        :param json:
        :param headers:
        :param paramspath:id:课程结构id
        :return:
        """

        url = url + f"/teachingApi/coursecontent/{paramspath}/existcoursecontent"
        r = requests.post(url=url, headers=headers, params=params, json=json)
        return r

    @classmethod
    def get_recommend(cls, url: str, params=None, headers=headers_web):
        """
        @Summary:根据课程查询是否首页推荐
        @Description:云课堂web老师端-添加课程使用
        :param url:
        :param params:
        :return:
        """
        pass

    @classmethod
    def post_coursecontent(cls, url: str, params=None, headers=None, json=None):
        """
        @Summary:获取教学内容列表
        @Description:老师端学生端获取教学内容列表
        :param url:
        :param params:
        :param json:
        :return:
        """
        url = url + "/teachingApi/v1/coursecontent"
        r = requests.post(url=url, params=params, headers=headers, json=json)
        return r

    @classmethod
    def post_coursemenu(cls, url: str, params=None, json=None, headers=headers_web):
        """
        @Summary:老师课程菜单配置
        @Description:云课堂web老师端使用
        :param url:
        :param params:
        :param json:
        :return:
        """
        pass

    @classmethod
    def post_coursemenuconf(cls, url: str, params=None, json=None, headers=headers_web):
        """
        @Summary:获取老师课程菜单配置信息
        @Description:云课堂web老师端使用
        :param url:
        :param params:
        :param json:
        :return:
        """
        pass

    @classmethod
    def post_statusinfo(cls, url: str, params=None, json=None, headers=headers_web):
        """
        @Summary:学生获取课程结构下学习效果、完成度以及课后作业分数
        @Description:云课堂web学生端使用
        :param url:
        :param params:
        :param json:
        :return:
        """
        url = url + "/teachingApi/v1/coursecontent/statusinfo"
        r = requests.post(url=url, params=params, json=json, headers=headers)
        return r
